package com.pine.common.beans.pineframework.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pine.common.util.time.TimeUtil;
import com.pine.common.util.tree.TreeInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 部门表查询响应体
 * </p>
 *
 * @author pine manage
 * @since 2024-08-12
 */
@Data
@Schema(title = "SysDeptQueryResponse", description = "部门表查询响应体")
public class SysDeptQueryResponse implements Serializable, TreeInfo<Long> {

    @Serial
    private static final long serialVersionUID = 7066774512480064627L;
    /**
     * 主键
     */
    @Schema(title = "id", description = "主键")
    private Long id;
    /**
     * 部门名称
     */
    @Schema(title = "name", description = "部门名称")
    private String name;
    /**
     * 部门编号
     */
    @Schema(title = "code", description = "部门编号")
    private String code;
    /**
     * 父节点id
     */
    @Schema(title = "parentId", description = "父节点id")
    private Long parentId;
    /**
     * 显示顺序
     */
    @Schema(title = "sort", description = "显示顺序")
    private Integer sort;
    /**
     * 状态:0=启用,1=禁用
     */
    @Schema(title = "status", description = "状态:0=启用,1=禁用")
    private Integer status;
    /**
     * 创建时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "createTime", description = "创建时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime createTime;
    /**
     * 创建人ID
     */
    @Schema(title = "createUserId", description = "创建人ID")
    private Long createUserId;
    /**
     * 更新时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "updateTime", description = "更新时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime updateTime;
    /**
     * 更新人ID
     */
    @Schema(title = "updateUserId", description = "更新人ID")
    private Long updateUserId;

    @Override
    public Comparable<?> getWeight() {
        return sort;
    }
}
